package com.bjdd.jdy.ui.register;

import com.bjdd.jdy.base.BaseModel;
import com.bjdd.jdy.base.BasePresenter;
import com.bjdd.jdy.base.BaseResult;
import com.bjdd.jdy.base.BaseView;
import com.bjdd.jdy.entity.TokenResult;
import com.bjdd.jdy.entity.User;

import java.io.IOException;

import rx.Observable;


/**
 * Created by shq1 on 2017/4/2.
 */

public interface RegisterContract {
    interface Model extends BaseModel{
        Observable<BaseResult<TokenResult>> getRegisterModel(String phone, String pwd, String code, String time, String sign);
        Observable<BaseResult<String>> getCodeModel(String mobile,String timestamp,String sign);
        Observable<BaseResult<User>> getUserInfo(String token,String userId);
        Observable<BaseResult<String>> getResultModel(String mobile,String pwd,String code,String timestamp,String sign);
        Observable<BaseResult<String>> getForgetCodeModel(String mobile, String timestamp, String sign);
    }
    interface View extends BaseView{
        void registerSuccess(User user);
        void resetSuccess();
    }
    abstract class Presenter extends BasePresenter<RegisterContract.Model,RegisterContract.View> {
        public abstract void register(String code,String phone,String pwd);
        public abstract void getCode(String phone) throws IOException;
        public abstract void forgetCommit(String code,String phone,String pwd);
        public abstract void getForgetCode(String phone);
    }
}
